package chaoyue.study.io;

import java.io.FileReader;
import java.util.Properties;

public class PropertiesTest {
    public static void main(String[] args) throws Exception {
        // 自己加载文件中的配置到Properties中
        FileReader reader = new FileReader("/Users/chaoyue/Downloads/config.txt");
        Properties pro = new Properties();
        // 可以直接从Reader进行加载
        pro.load(reader);
        System.out.println(pro);
        System.out.println(pro.getProperty("Key1"));
        System.out.println(pro.getProperty("Key2"));
        reader.close();
    }
}
